/***********************************************************************
 * Module:  LoaiBanh.cs
 * Author:  Tuan Nguyen
 * Purpose: Definition of the Class LoaiBanh
 ***********************************************************************/

using System;

public class LoaiBanh
{
   public int MaLoaiBanh;
   public string TenLoaiBanh;
   
   public System.Collections.ArrayList banh;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetBanh()
   {
      if (banh == null)
         banh = new System.Collections.ArrayList();
      return banh;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetBanh(System.Collections.ArrayList newBanh)
   {
      RemoveAllBanh();
      foreach (Banh oBanh in newBanh)
         AddBanh(oBanh);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddBanh(Banh newBanh)
   {
      if (newBanh == null)
         return;
      if (this.banh == null)
         this.banh = new System.Collections.ArrayList();
      if (!this.banh.Contains(newBanh))
      {
         this.banh.Add(newBanh);
         newBanh.SetLoaiBanh(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveBanh(Banh oldBanh)
   {
      if (oldBanh == null)
         return;
      if (this.banh != null)
         if (this.banh.Contains(oldBanh))
         {
            this.banh.Remove(oldBanh);
            oldBanh.SetLoaiBanh((LoaiBanh)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllBanh()
   {
      if (banh != null)
      {
         System.Collections.ArrayList tmpBanh = new System.Collections.ArrayList();
         foreach (Banh oldBanh in banh)
            tmpBanh.Add(oldBanh);
         banh.Clear();
         foreach (Banh oldBanh in tmpBanh)
            oldBanh.SetLoaiBanh((LoaiBanh)null);
         tmpBanh.Clear();
      }
   }

}